<#include "../common/header.htm">
<div class="content-wrapper" style="height:100%;">
	<section class="content">
			<div id="exceptionAnalysis" >
				<el-tabs v-model="which_tab" type="card" @tab-click="handleClick">
					<el-tab-pane label=规律交易 name="first">
						<div>
							<div class="importti">
								<span class="sming"></span>
								<span class="smtit">温馨提示：主要用于分析某一账户与其他账户产生交易的间隔天数比较固定，且连续数月出现</span>
							</div>
						<div class="stream_search" >
							<el-form id="listForm" :inline="true"  :model="form" class="demo-form-inline">
								<el-form-item class="form_z" label="交易日期">
									<el-date-picker
											v-model="form.beginTime"
											name="beginTime"
											type="date"
									>
									</el-date-picker>
								</el-form-item>
								<el-form-item class="el-form-item refsh" label="至">
									<el-date-picker
											v-model="form.endTime"
											name="endTime"
											type="date"
									>
									</el-date-picker>
								</el-form-item>
								<el-form-item label="金额">
									<el-input v-model="form.minTradeMoney" name="minTradeMoney" placeholder=""></el-input>
								</el-form-item>
								<el-form-item class="el-form-item refsh" label="至">
									<el-input v-model="form.maxTradeMoney" name="maxTradeMoney" placeholder=""></el-input>
								</el-form-item>
								<el-form-item class="exceday" label="每月交易间隔天数">
									<el-select v-model="form.interval_day" placeholder="请选择">
										<el-option
												v-for="item in interval_day_options"
												:key="item.value"
												:label="item.label"
												:value="item.value">
										</el-option>
									</el-select>
								</el-form-item>
								<el-form-item class="exceday" label="至少出现几个月">
									<el-select v-model="form.count" placeholder="请选择">
										<el-option
												v-for="item in count_options"
												:key="item.value"
												:label="item.label"
												:value="item.value">
										</el-option>
									</el-select>
								</el-form-item>


								<el-form-item>
									<el-button type="primary" @click="onSubmit">分析</el-button>
								</el-form-item>
								<el-form-item>
									<el-button class="el-button el-button&#45;&#45;default reset_button"  @click="clear">重置</el-button>
								</el-form-item>
								<el-form-item>
									<el-button type="primary" class="daobtn" @click="exportExcel">导出</el-button>
								</el-form-item>
							</el-form>
						</div>
						<div class="stream_body" >
							<div>
								<table id="dg1"></table>
							</div>
						</div>
						</div>
					</el-tab-pane>
					<el-tab-pane label="短时间内的存款/取款" name="second">
						<div>
							<div class="importti">
								<span class="sming"></span>
								<span class="smtit">温馨提示：主要用于分析某一时间段内存款、取款的情况，可根据交易日期、金额、次数筛选交易情况，便于掌握目标账号的可疑点</span>
							</div>
						<div class="stream_search" >
							<el-form id="listForm" :inline="true"  :model="form" class="demo-form-inline">
								<el-form-item label="收付标志" class="inouttype">
									<el-select v-model="form.sign" placeholder="请选择">
										<el-option label="请选择" value=""></el-option>
										<el-option label="流入" value="0"></el-option>
										<el-option label="流出" value="1"></el-option>
									</el-select>
								</el-form-item>
								<el-form-item class="form_z" label="交易日期">
									<el-date-picker
											v-model="form.beginTime"
											name="beginTime"
											type="date"
									>
									</el-date-picker>
								</el-form-item>
								<el-form-item class="el-form-item refsh" label="至">
									<el-date-picker
											v-model="form.endTime"
											name="endTime"
											type="date"
									>
									</el-date-picker>
								</el-form-item>
								<el-form-item label="金额">
									<el-input v-model="form.minTradeMoney" name="minTradeMoney" placeholder=""></el-input>
								</el-form-item>
								<el-form-item class="el-form-item refsh" label="至">
									<el-input v-model="form.maxTradeMoney" name="maxTradeMoney" placeholder=""></el-input>
								</el-form-item>
								<el-form-item class="inoutci" label="月交易次数>=">
									<el-input v-model="form.count" name="count" placeholder=""></el-input>
								</el-form-item>
								<el-form-item>
									<el-button type="primary" @click="onSubmit">分析</el-button>
								</el-form-item>
								<el-form-item>
									<el-button class="el-button el-button&#45;&#45;default reset_button"  @click="clear">重置</el-button>
								</el-form-item>
								<el-form-item>
									<el-button type="primary" class="daobtn" @click="exportExcel">导出</el-button>
								</el-form-item>
							</el-form>
						</div>
						<div class="stream_body" >
							<div>
								<table id="dg2"></table>
							</div>
						</div>
						</div>
					</el-tab-pane>
					<el-tab-pane label="4~5w之间交易分析" name="third">
						<div>
							<div class="importti">
								<span class="sming"></span>
								<span class="smtit">温馨提示：主要用于分析某一时间段内交易的金额在4~5万元之间的交易次数，银行规定个人交易超过5万元需上报，有些交易会控制在4~5万元之间</span>
							</div>
							<div class="stream_search" >
								<el-form id="listForm" :inline="true"  :model="form" class="demo-form-inline">
									<el-form-item class="form_z" label="交易日期">
										<el-date-picker
												v-model="form.beginTime"
												name="beginTime"
												type="date"
										>
										</el-date-picker>
									</el-form-item>
									<el-form-item class="el-form-item refsh" label="至">
										<el-date-picker
												v-model="form.endTime"
												name="endTime"
												type="date"
										>
										</el-date-picker>
									</el-form-item>
									<el-form-item>
										<el-button type="primary" @click="onSubmit">分析</el-button>
									</el-form-item>
									<el-form-item>
										<el-button class="el-button el-button&#45;&#45;default reset_button"  @click="clear">重置</el-button>
									</el-form-item>
									<el-form-item>
										<el-button type="primary" class="daobtn" @click="exportExcel">导出</el-button>
									</el-form-item>
								</el-form>
							</div>
							<div class="stream_body" >
								<table id="dg3"></table>
							</div>
						</div>
					</el-tab-pane>
					<el-tab-pane label="pos机消费分析" name="fourth">
						<div>
							<div class="importti">
								<span class="sming"></span>
								<span class="smtit">温馨提示：主要用于分析某一时间段内选用pos机消费的记录，可根据交易日期，交易金额，交易次数来筛选交易记录</span>
							</div>
							<div class="stream_search" >
								<el-form id="listForm" :inline="true"  :model="form" class="demo-form-inline">
									<el-form-item class="form_z" label="交易日期">
										<el-date-picker
												v-model="form.beginTime"
												name="beginTime"
												type="date"
										>
										</el-date-picker>
									</el-form-item>
									<el-form-item class="el-form-item refsh" label="至">
										<el-date-picker
												v-model="form.endTime"
												name="endTime"
												type="date"
										>
										</el-date-picker>
									</el-form-item>
									<el-form-item label="金额">
										<el-input v-model="form.minTradeMoney" name="minTradeMoney" placeholder=""></el-input>
									</el-form-item>
									<el-form-item class="el-form-item refsh" label="至">
										<el-input v-model="form.maxTradeMoney" name="maxTradeMoney" placeholder=""></el-input>
									</el-form-item>
									<el-form-item class="inoutci" label="交易次数>=">
										<el-input v-model="form.count" name="count" placeholder=""></el-input>
									</el-form-item>
									<el-form-item>
										<el-button type="primary" @click="onSubmit">分析</el-button>
									</el-form-item>
									<el-form-item>
										<el-button class="el-button el-button&#45;&#45;default reset_button"  @click="clear">重置</el-button>
									</el-form-item>
									<el-form-item>
										<el-button type="primary" class="daobtn" @click="exportExcel">导出</el-button>
									</el-form-item>
								</el-form>
							</div>
							<table id="dg4"></table>
						</div>
					</el-tab-pane>
				</el-tabs>
			</div>
	</section>
</div>
<script>
	/*
    function refreshSize(){
        var totolHeight =  document.documentElement.clientHeight;
        var height = totolHeight - 150;
        console.log(totolHeight + ' - ' + height);
        document.getElementById('dg1').style.height = height+'px';
        document.getElementById('dg2').style.height = height+'px';
        document.getElementById('dg3').style.height = height+'px';
        document.getElementById('dg4').style.height = height+'px';
    };
    refreshSize();
    window.onresize = refreshSize;*/

	var caseId=parent.caseId;
	$(document).ready(function(){
		 $(window).resize(function(){
			 $(".el-tabs__item").each(function(i,item){
				 if($(this).hasClass("is-active")){
					 var n=i+1;
					 $('#dg'+n).datagrid('resize',{
                         height:($(window).height())-($('.stream_search').outerHeight(true))-100,
					 });
				 }
			 })
		});
	});
    function tabDialog(account_body_card,account_rival_card,month,account_body,account_rival) {
        var param = {
            accountBodyCard:account_body_card,
            accountRivalCard:account_rival_card,
			accountBody:account_body,
			accountRival:account_rival,
            sign:exceptionAnalysis.form.sign,
            order:exceptionAnalysis.sortMap2.order,
            prop:exceptionAnalysis.sortMap2.prop,
            minTradeMoney: exceptionAnalysis.form.minTradeMoney,
            maxTradeMoney: exceptionAnalysis.form.maxTradeMoney,
            minAccountMoney: exceptionAnalysis.form.minAccountMoney,
            maxAccountMoney: exceptionAnalysis.form.maxAccountMoney,
            beginTime: getMyDate(exceptionAnalysis.form.beginTime),
            endTime: getMyDate(exceptionAnalysis.form.endTime),
            month:month,
            caseId:caseId,
            content_abstract:exceptionAnalysis.form.content_abstract,
            currentPage2:exceptionAnalysis.currentPage2,
            pageSize5:exceptionAnalysis.pageSize5,
        };
        if(parent._checkedAccount.length>=1000){
            param.cardList="-1";//默认超过1000个节点为全选，不需要去后台传数据
        };
        var d = top.dialog({
            title : '交易次数详情',
            modal : true,
            url : '${ctx}/bill/stream/d3/exceptionAnalysisDialogInit',
            height : 750,
            width : 1500,
            data : param,
            onshow : function () {
            }
        });
        d.show();
        return false;
    }

	let exceptionAnalysis=new Vue({
		el:"#exceptionAnalysis",
		data:{
			dialogVisible:false,
			which_tab:"first",
			tableData: [],
			tableData2: [],
			currentPage_first:1,
			currentPage_second:1,
			currentPage_third:1,
			currentPage_fourth:1,
			pageSize1:20,
            pageSize2:20,
            pageSize3:20,
            pageSize4:20,
			currentPage2:1,
			pageSize5:"20",
			form: {
				interval_day: '5',
				count: '2',
				minTradeMoney: '',
				maxTradeMoney: '',
				minAccountMoney: '',
				maxAccountMoney: '',
				beginTime: '',
				endTime: '',
				sign:''
			},
			total:"",
			total2:"",
			interval_day_options: [{
				value: '5',
				label: '5'
			}, {
				value: '6',
				label: '6'
			}, {
				value: '7',
				label: '7'
			}, {
				value: '8',
				label: '8'
			}, {
				value: '9',
				label: '9'
			}],
			count_options: [{
				value: '2',
				label: '2'
			}, {
				value: '3',
				label: '3'
			}, {
				value: '4',
				label: '4'
			}, {
				value: '5',
				label: '5'
			}, {
				value: '6',
				label: '6'
			}],
			row:"",
			sortMap:{},//排序用的
			sortMap2:{},//排序用的
		},
		filters: {
			formatDate(time) {
				var date = new Date(time);
				return formatDate(date, 'yyyy-MM-dd hh:mm');
			},
			formatMoney(value) {
				if(!value) return 0;
				if (Number.isInteger(value)) {
					return value.toString().replace(/(\d)(?=(\d{3})+$)/g,'$1,');
				} else {
					return value.toString().replace(/(\d)(?=(\d{3})+\.)/g,'$1,');
				}
			},
			formatSign(sign) {
				if(sign==1){
					return '流出';
				}else if(sign==0){
					return '流入';
				}else{
					return ""
				}
			}
		},
		methods: {
			handleClick(tab, event) {
				this.tabApi();
			},
			onSubmit() {
				if (this.which_tab=='first'){
					dg1();
				} else if (this.which_tab=='second'){
					dg2();
				} else if (this.which_tab=='third'){
					dg3();
				}else if (this.which_tab=='fourth'){
					dg4()
				}

			},
			tabApi(){
				this.clear()
				if (this.which_tab=='first'){
					this.form.count=2
					setTimeout(dg1,100);
				} else if (this.which_tab=='second'){
					this.form.count=2
					setTimeout(dg2,100);
				} else if (this.which_tab=='third'){
					this.form.minTradeMoney=40000
					this.form.maxTradeMoney=50000
					this.form.count=""
					setTimeout(dg3,100);
				}else if (this.which_tab=='fourth'){
					this.form.content_abstract='pos机'
					this.form.count=""
					setTimeout(dg4,100);
				}
			},
			clear(){
				this.form={
					interval_day: '5',
					count: this.which_tab=='first'?'2':this.which_tab=='second'?'15':'',
					minTradeMoney: '',
					maxTradeMoney: '',
					beginTime: '',
					endTime: '',
					content_abstract:'',
					sign:''
				}
                this.row=''
			},
			exportExcel(){
				var xhr = new XMLHttpRequest();
				var url="${ctx}/exception_analysis/down";
				xhr.open('POST', url, true);
				xhr.responseType = "blob";  // 返回类型blob
				// 定义请求完成的处理函数
				xhr.onload = function () {
					// 请求完成
					if (this.status === 200) {
						var content = this.response;
						var aTag = document.createElement('a');
						var blob = new Blob([content]);
						var headerName = xhr.getResponseHeader("Content-disposition");
						var fileName = decodeURIComponent(headerName).substring(20);
						aTag.download = fileName;
						aTag.href = URL.createObjectURL(blob);
						aTag.click();
						URL.revokeObjectURL(blob);
					}
				};
				// 发送ajax请求
				var formdata=new FormData();
				formdata.append("interval_day",this.form.interval_day);
				formdata.append("count",this.form.count);
				formdata.append("minTradeMoney",this.form.minTradeMoney);
				formdata.append("maxTradeMoney",this.form.maxTradeMoney);
				formdata.append("cardList",arr);
				formdata.append("caseId",caseId);
				formdata.append("sign",this.form.sign);
				formdata.append("whichTab",this.which_tab);
				formdata.append("beginTime",getMyDate(this.form.beginTime));
				formdata.append("endTime",getMyDate(this.form.endTime));
				xhr.send(formdata);
			}
		}
	})

	var arr = new Array();
	function _checkedCallback() {
		if(parent._checkedAccount&&parent._checkedAccount.length>0){
			arr = parent._checkedAccount.map(m=>{
				return "'"+m.split("_")[1]+"'";
			})
			arr=arr.join(',');
			exceptionAnalysis.tabApi()
		}else{
			arr=[]
			exceptionAnalysis.tabApi()
		}
	}
	_checkedCallback()
	/*-----------------------easyui表格-----------------------------*/
	function dg1(){
		$('#dg1').datagrid({
			url: '${ctx}/exception_analysis/list_easyui',
			method: 'post',
			iconCls: 'icon-save',
			queryParams:{//每次请求的参数
				interval_day: exceptionAnalysis.form.interval_day,
				count: exceptionAnalysis.form.count,
				minTradeMoney: exceptionAnalysis.form.minTradeMoney,
				maxTradeMoney: exceptionAnalysis.form.maxTradeMoney,
				beginTime: getMyDate(exceptionAnalysis.form.beginTime),
				endTime: getMyDate(exceptionAnalysis.form.endTime),
				cardList: arr,
				caseId:caseId
			},
            pageList:[30,50,100,150,200],
			pageNumber:1,//当前页号,
			//sortName:"TOTALMONEY",//排序列名称 设置后将向后台传送名为sort的post/get参数
			//sortOrder:"desc",//排序列升降序 设置后将向后台传送名为order的post/get参数
			pageSize:30,//每页显示记录数
			loadMsg:"正在加载，请稍后",//加载数据时的提示信息
			emptyMsg:"暂无信息",//加载数据为空时的信息
			height: ($(window).height())-($('.stream_search').outerHeight(true))-100,
			rownumbers:true,//序号
			fitColumns: true,//使表格自适应页面宽度
			pagination: true,//是否分页
			singleSelect: true,
			columns:[[ //每一列的具体设置。
                {field:'account_body_card',title:'交易主体账号'},
				{field:'account_body',title:'交易主体名称'},
                {field:'account_rival_card',title:'交易对手账号'},
				{field:'account_rival',title:'交易对手名称'},
				{field:'time_slot',title:'交易日期间隔'},
				{field:'sum_account_money',title:'交易总额', sortable : true},
				{field:'trade_count',title:'交易次数', sortable : true,
					formatter: function(value,row,index){ //当前值，当前的row，当前的索引
						let ACCOUNT_BODY_CARD = row.account_body_card?row.account_body_card:'';
						let ACCOUNT_RIVAL_CARD = row.account_rival_card?row.account_rival_card:'';
						let MONTH = row.month?row.month:'';
						let account_body = row.account_body?row.account_body:'';
						let account_rival = row.account_rival?row.account_rival:'';
						return '<a href="#" onclick="tabDialog(\''+ACCOUNT_BODY_CARD+'\',\''+ACCOUNT_RIVAL_CARD+"\',\'"+MONTH+'\',\''+account_body+'\',\''+account_rival+'\')">'+value+'</a>'
					}
				}
			]],
			onHeaderContextMenu: function(e, field){
				e.preventDefault();
				if (!cmenu){
					createColumnMenu("#dg1");
				}
				cmenu.menu('show', {
					left:e.pageX,
					top:e.pageY
				});
			}
		})
		var cmenu;
		function createColumnMenu(id){
			cmenu = $('<div/>').appendTo('body');
			cmenu.menu({
				onClick: function(item){
					if (item.iconCls == 'icon-ok'){
						$(id).datagrid('hideColumn', item.name);
						cmenu.menu('setIcon', {
							target: item.target,
							iconCls: 'icon-empty'
						});
					} else {
						$(id).datagrid('showColumn', item.name);
						cmenu.menu('setIcon', {
							target: item.target,
							iconCls: 'icon-ok'
						});
					}
				}
			});
			var fields = $(id).datagrid('getColumnFields');
			for(var i=0; i<fields.length; i++){
				var field = fields[i];
				var col = $(id).datagrid('getColumnOption', field);
				cmenu.menu('appendItem', {
					text: col.title,
					name: field,
					iconCls: 'icon-ok'
				});
			}
		}
	};
	function dg2(){
		$('#dg2').datagrid({
			url: '${ctx}/exception_analysis/shortTimeTransaction_easyui',
			method: 'post',
			iconCls: 'icon-save',
			queryParams:{//每次请求的参数
				count: exceptionAnalysis.form.count,
				minTradeMoney: exceptionAnalysis.form.minTradeMoney,
				maxTradeMoney: exceptionAnalysis.form.maxTradeMoney,
				beginTime: getMyDate(exceptionAnalysis.form.beginTime),
				endTime: getMyDate(exceptionAnalysis.form.endTime),
				cardList: arr,
				caseId:caseId,
				sign:exceptionAnalysis.form.sign
			},
            pageSize:30,
            pageList:[30,50,100,150,200],
			pageNumber:1,//当前页号,
			//sortName:"TOTALMONEY",//排序列名称 设置后将向后台传送名为sort的post/get参数
			//sortOrder:"desc",//排序列升降序 设置后将向后台传送名为order的post/get参数

			loadMsg:"正在加载，请稍后",//加载数据时的提示信息
			emptyMsg:"暂无信息",//加载数据为空时的信息
			height: ($(window).height())-($('.stream_search').outerHeight(true))-150,
			rownumbers:true,//序号
			fitColumns: true,//使表格自适应页面宽度
			pagination: true,//是否分页
			singleSelect: true,
			columns:[[ //每一列的具体设置。
                {field:'account_body_card',title:'交易主体账号'},
                {field:'account_body',title:'交易主体'},
                {field:'account_rival_card',title:'交易对手账号'},
                {field:'account_rival',title:'交易对手'},
				{field:'month',title:'交易月份',sortable : true},
				{field:'sum_account_money',title:'交易总额', sortable : true},
				{field:'trade_count',title:'交易次数', sortable : true,
					formatter: function(value,row,index){ //当前值，当前的row，当前的索引
						let ACCOUNT_BODY_CARD = row.account_body_card?row.account_body_card:'';
						let ACCOUNT_RIVAL_CARD = row.account_rival_card?row.account_rival_card:'';
						let MONTH = row.month?row.month:'';
						let account_body = row.account_body?row.account_body:'';
						let account_rival = row.account_rival?row.account_rival:'';
						return '<a href="#" onclick="tabDialog(\''+ACCOUNT_BODY_CARD+'\',\''+ACCOUNT_RIVAL_CARD+"\',\'"+MONTH+'\',\''+account_body+'\',\''+account_rival+'\')">'+value+'</a>'
					}
				}
			]],
			onHeaderContextMenu: function(e, field){
				e.preventDefault();
				if (!cmenu){
					createColumnMenu("#dg2");
				}
				cmenu.menu('show', {
					left:e.pageX,
					top:e.pageY
				});
			}
		});
		var cmenu;
		function createColumnMenu(id){
			cmenu = $('<div/>').appendTo('body');
			cmenu.menu({
				onClick: function(item){
					if (item.iconCls == 'icon-ok'){
						$(id).datagrid('hideColumn', item.name);
						cmenu.menu('setIcon', {
							target: item.target,
							iconCls: 'icon-empty'
						});
					} else {
						$(id).datagrid('showColumn', item.name);
						cmenu.menu('setIcon', {
							target: item.target,
							iconCls: 'icon-ok'
						});
					}
				}
			});
			var fields = $(id).datagrid('getColumnFields');
			for(var i=0; i<fields.length; i++){
				var field = fields[i];
				var col = $(id).datagrid('getColumnOption', field);
				cmenu.menu('appendItem', {
					text: col.title,
					name: field,
					iconCls: 'icon-ok'
				});
			}
		}
	};
	function dg3(){
		$('#dg3').datagrid({
			url: '${ctx}/exception_analysis/yinHangTransaction_easyui',
			method: 'post',
			iconCls: 'icon-save',
			queryParams:{//每次请求的参数
				count: exceptionAnalysis.form.count,
				minTradeMoney: exceptionAnalysis.form.minTradeMoney,
				maxTradeMoney: exceptionAnalysis.form.maxTradeMoney,
				minAccountMoney: exceptionAnalysis.form.minAccountMoney,
				maxAccountMoney: exceptionAnalysis.form.maxAccountMoney,
				beginTime: getMyDate(exceptionAnalysis.form.beginTime),
				endTime: getMyDate(exceptionAnalysis.form.endTime),
				cardList: arr,
				caseId:caseId
			},
			pageList:[10,20,40,50,100],//每页记录数选择范围设置
			pageNumber:1,//当前页号,
			//sortName:"TOTALMONEY",//排序列名称 设置后将向后台传送名为sort的post/get参数
			//sortOrder:"desc",//排序列升降序 设置后将向后台传送名为order的post/get参数
			pageSize:20,//每页显示记录数
			loadMsg:"正在加载，请稍后",//加载数据时的提示信息
			emptyMsg:"暂无信息",//加载数据为空时的信息
			height: ($(window).height())-($('.stream_search').outerHeight(true))-150,
			rownumbers:true,//序号
			fitColumns: true,//使表格自适应页面宽度
			pagination: true,//是否分页
			singleSelect: true,
			columns:[[ //每一列的具体设置。
                {field:'account_body_card',title:'交易主体账号'},
				{field:'account_body',title:'交易主体'},
                {field:'account_rival_card',title:'交易对手账号'},
				{field:'account_rival',title:'交易对手'},
				{field:'sum_account_money',title:'交易总额', sortable : true},
				{field:'trade_count',title:'交易次数', sortable : true,
					formatter: function(value,row,index){ //当前值，当前的row，当前的索引
						let ACCOUNT_BODY_CARD = row.account_body_card?row.account_body_card:'';
						let ACCOUNT_RIVAL_CARD = row.account_rival_card?row.account_rival_card:'';
						let MONTH = row.month?row.month:'';
						let account_body = row.account_body?row.account_body:'';
						let account_rival = row.account_rival?row.account_rival:'';
						return '<a href="#" onclick="tabDialog(\''+ACCOUNT_BODY_CARD+'\',\''+ACCOUNT_RIVAL_CARD+"\',\'"+MONTH+'\',\''+account_body+'\',\''+account_rival+'\')">'+value+'</a>'
					}
				}
			]],
			onHeaderContextMenu: function(e, field){
				e.preventDefault();
				if (!cmenu){
					createColumnMenu("#dg3");
				}
				cmenu.menu('show', {
					left:e.pageX,
					top:e.pageY
				});
			}
		});
		var cmenu;
		function createColumnMenu(id){
			cmenu = $('<div/>').appendTo('body');
			cmenu.menu({
				onClick: function(item){
					if (item.iconCls == 'icon-ok'){
						$(id).datagrid('hideColumn', item.name);
						cmenu.menu('setIcon', {
							target: item.target,
							iconCls: 'icon-empty'
						});
					} else {
						$(id).datagrid('showColumn', item.name);
						cmenu.menu('setIcon', {
							target: item.target,
							iconCls: 'icon-ok'
						});
					}
				}
			});
			var fields = $(id).datagrid('getColumnFields');
			for(var i=0; i<fields.length; i++){
				var field = fields[i];
				var col = $(id).datagrid('getColumnOption', field);
				cmenu.menu('appendItem', {
					text: col.title,
					name: field,
					iconCls: 'icon-ok'
				});
			}
		}
	};
	function dg4(){
		$('#dg4').datagrid({
			url: '${ctx}/exception_analysis/postTransaction_easyui',
			method: 'post',
			iconCls: 'icon-save',
			queryParams:{//每次请求的参数
				count: exceptionAnalysis.form.count,
				minTradeMoney: exceptionAnalysis.form.minTradeMoney,
				maxTradeMoney: exceptionAnalysis.form.maxTradeMoney,
				minAccountMoney: exceptionAnalysis.form.minAccountMoney,
				maxAccountMoney: exceptionAnalysis.form.maxAccountMoney,
				beginTime: getMyDate(exceptionAnalysis.form.beginTime),
				endTime: getMyDate(exceptionAnalysis.form.endTime),
				cardList: arr,
				caseId:caseId
			},
			pageList:[10,20,40,50,100],//每页记录数选择范围设置
			pageNumber:1,//当前页号,
			//sortName:"TOTALMONEY",//排序列名称 设置后将向后台传送名为sort的post/get参数
			//sortOrder:"desc",//排序列升降序 设置后将向后台传送名为order的post/get参数
			pageSize:20,//每页显示记录数
			loadMsg:"正在加载，请稍后",//加载数据时的提示信息
			emptyMsg:"暂无信息",//加载数据为空时的信息
			height: ($(window).height())-($('.stream_search').outerHeight(true))-150,
			rownumbers:true,//序号
			fitColumns: true,//使表格自适应页面宽度
			pagination: true,//是否分页
			singleSelect: true,
			columns:[[ //每一列的具体设置。
                {field:'account_body_card',title:'交易主体账号'},
				{field:'account_body',title:'交易主体'},
                {field:'account_rival_card',title:'交易对手账号'},
				{field:'account_rival',title:'交易对手'},
				{field:'sum_account_money',title:'交易总额', sortable : true},
				{field:'trade_count',title:'交易次数', sortable : true,
					formatter: function(value,row,index){ //当前值，当前的row，当前的索引
						let ACCOUNT_BODY_CARD = row.account_body_card?row.account_body_card:'';
						let ACCOUNT_RIVAL_CARD = row.account_rival_card?row.account_rival_card:'';
						let MONTH = row.month?row.month:'';
						let account_body = row.account_body?row.account_body:'';
						let account_rival = row.account_rival?row.account_rival:'';
						return '<a href="#" onclick="tabDialog(\''+ACCOUNT_BODY_CARD+'\',\''+ACCOUNT_RIVAL_CARD+"\',\'"+MONTH+'\',\''+account_body+'\',\''+account_rival+'\')">'+value+'</a>'
					}
				}
			]],
			onHeaderContextMenu: function(e, field){
				e.preventDefault();
				if (!cmenu){
					createColumnMenu("#dg4");
				}
				cmenu.menu('show', {
					left:e.pageX,
					top:e.pageY
				});
			}
		});
		var cmenu;
		function createColumnMenu(id){
			cmenu = $('<div/>').appendTo('body');
			cmenu.menu({
				onClick: function(item){
					if (item.iconCls == 'icon-ok'){
						$(id).datagrid('hideColumn', item.name);
						cmenu.menu('setIcon', {
							target: item.target,
							iconCls: 'icon-empty'
						});
					} else {
						$(id).datagrid('showColumn', item.name);
						cmenu.menu('setIcon', {
							target: item.target,
							iconCls: 'icon-ok'
						});
					}
				}
			});
			var fields = $(id).datagrid('getColumnFields');
			for(var i=0; i<fields.length; i++){
				var field = fields[i];
				var col = $(id).datagrid('getColumnOption', field);
				cmenu.menu('appendItem', {
					text: col.title,
					name: field,
					iconCls: 'icon-ok'
				});
			}
		}
	};
</script>
<style>
	i.el-input__icon.el-icon-caret-top {
		right: -5px;
	}
	.inouttype .el-input__inner {
		width: 90px;
	}
	.inoutci .el-input__inner {
		width: 60px;
		text-align: center;
	}
	.exceday .el-input__inner {
		width: 60px;
	}
	.importti{
		margin-top: 10px;
	}
	.el-pagination .el-select .el-input .el-input__inner {
		width: 106px;
		height: 35px;
	}
	.el-form-item.el-form-item.form-to {
		margin-left: -23px;
	}
	#exceptionAnalysis .el-tabs__header{
		background: white;
	}
	#hidebox span{
		font-size: 20px;
	}
	.badge{
		background-color: #f7051f;
	}
	.content {
		padding: 10px;
		padding-top: 0!important;
		padding-left: 0!important;
	}
	.el-pagination {
		margin-top: 10px;
	}
	.stream_search {
		margin: 0 0 10px 0;
	}
	.el-form-item__label{
		color: #6f7689;
		font-weight: 400;
		font-size: 13px;
	}
	.casemanage-switch .casemanage-zhexiantu.active {
		background-color: #4695ed;
	}
	.casemanage-switch .casemanage-zhexiantu {
		background-color: #f2f6f9;
		float: left;
		width: 50px;
		height: 35px;
		display: block;
		cursor: pointer;
		border-top-left-radius: 5px;
		border-bottom-left-radius: 5px;
		line-height: 35px;
		text-align: center;
	}
	#font_zhexian{
		color: #C1C2C3;
		font-size: 18px;
	}
	#font_zhexian.active{
		color: #F4F9FE;
	}
	.el-input__inner{
		border-color: #D2D6DE;
		height: 34px;
		width: 179px;
		font-size: 12px;
		border-color: #e4e4e4;
	}
	.el-input__inner:hover{
		border-color:#4695ed;
	}
	.el-input__inner:focus{
		border-color:#4695ed;
	}
	.el-dialog--small{
		width: 88%;
	}
	.el-button--primary{
		background-color:#4695ed;
		border-color:#4695ed;
		width: 70px;
	}
	.el-button--primary:focus, .el-button--primary:hover{
		background: #61a8f5;
		border-color: #61a8f5;
	}
	button.el-button.el-button--default.reset_button {
		background-color: #f4f4f4;
		color: #444;
		border-color: #ddd;
	}
	.button.el-button.el-button--default.reset_button:focus, button.el-button.el-button--default.reset_button:hover{
		border-color: #adadad;
		background-color: #e7e7e7;
	}
	.el-button{
		margin-right: -15px;
		height: 32px;
		line-height: 10px;
	}
	h4#myLargeModalLabel {
		margin-left: 30px;
		font-size: 20px;
	}
	.modal-dialog{
		height: 92%;
		width: 90%;
	}
	div#fullScreenContent {
		margin: auto auto;
		position: relative;
	}
	.showD3 {
		display: inline-block;
		background-color: #F2F6F9;
		width: 50px;
		height: 35px;
	}
	button.btn.btn-primary-fullScreen{
		border: transparent;
		height: 24px;
		background: url(../../../imgs/icon-relative.png);
		background-size: 20px;
		background-repeat: no-repeat;
		background-position: center center;
		display: inline-block;
		width: 50px;
		height: 35px;
	}
	button.btn.btn-primary.active{
		background-color: #4595ec;
	}
	.btn-primary:active:focus, .btn-primary:active:hover{
		background-color: transparent;
		border-color: transparent;
	}
	svg {
		width: 100%;
		height: 95%;
	}
	button.close span {
		font-size: 55px;
		font-weight: 350;
	}
	.modal-header .close {
		margin-top: -19px;
	}
	.el-tabs.el-tabs--card .el-tabs__header{
		margin-bottom: 0px;
	}
	.el-select-dropdown__wrap{
		overflow: hidden !important;
	}
</style>